import java.util.Scanner;

import static java.lang.String.valueOf;
import static jdk.nashorn.internal.objects.NativeString.charAt;

public class test {

    //返回最后一个字符串的长度
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        int ret = s.lastIndexOf(" ", s.length() - 1);
        int count = 0;
        for(int i = ret + 1; i < s.length(); i++) {
            if(s.charAt(i) != '\0') {
                count++;
            }
        }
        System.out.println(count);
    }

    //给定一个字符串s，找到它的第一个不重复的字符，并返回它的索引。如果不存在，则返回-1
    public static int isRepeat(String s) {
        int[] count = new int[26];

        for(int i = 0; i < s.length(); i++) {
            count[s.charAt(i) - 'a']++;
        }
        for(int i = 0; i < s.length(); i++) {
            if(count[s.charAt(i) - 'a'] == 1) {
                return i;
            }
        }
        return -1;
    }
    public static void main3(String[] args) {
        String s = "loveleetcode";
        System.out.println(isRepeat(s));
    }

    public static void main2(String[] args) {
//        String s1 = valueOf(1234);
//        String s2 = valueOf(12.34);
//        String s3 = valueOf(true);
//        System.out.println(s1);
//        System.out.println(s2);
//        System.out.println(s3);
//        String s1 = "helloe";
//        char[] ch = s1.toCharArray();
//        for(int i = 0; i < ch.length; i++) {
//            System.out.print(ch[i] + " ");
//        }
//        System.out.println();
//        String s2 = String.format("%d-%d-%d ", 2024, 3, 10);
//        System.out.println(s2);
//        String s3 = new String(ch);
//        System.out.println(s3.replaceAll("l", "o"));
//        System.out.println(s3.replaceFirst("e", "o"));
//        String s1 = " hello.world hello.bit " ;
////        String[] res = s1.split("\\.");
////        for(String x : res) {
////            System.out.println(x);
////        }
//
//        System.out.println("[" + s1 + "]");
//        System.out.println("[" + s1.trim() + "]");

        try{
            int[] array = {1,2,3};
            System.out.println(array[3]);
            System.out.println("dasda");
        }catch(ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
            System.out.println("空指针异常!!");
        }
        System.out.println("hahah");
    }
    //回文数（字母或者数字）
    public static boolean isNumorChar(char s) {
        if(s >= '0' && s <= '9' || s >= 'a' && s <= 'z') {
            return true;
        }
        return false;
    }
    public static boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int i = 0;
        int j = s.length() - 1;
        while(i <= j) {
            while(!(isNumorChar(s.charAt(i))) && i < j) {
                i++;
            }
            while(!(isNumorChar(s.charAt(j))) && i < j) {
                j--;
            }
            if(s.charAt(i) == s.charAt(j)) {
                i++;
                j--;
            }else {
                return false;
            }
        }
        return true;
    }
    public static void main1(String[] args) {
        String s = "A man, a plan, a canal: Panama";
        System.out.println(isPalindrome(s));
    }
}
